{extend name="layout:base" /}

{block name="content"}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">

            <div class="layui-form-item">
                <label class="layui-form-label">网站名</label>
                <div class="layui-form-mid layui-word-aux">{$article.urlName}</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">网址</label>
                <div class="layui-form-mid layui-word-aux">{$article.url}</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">网站后台</label>
                <div class="layui-form-mid layui-word-aux">{$article.urlback}</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">后台帐号</label>
                <div class="layui-form-mid layui-word-aux">{$article.urlback_name}</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">后台密码</label>
                <div class="layui-form-mid layui-word-aux">{$article.urlback_pwd}</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">ftp</label>
                <div class="layui-form-mid layui-word-aux">{$article.ftp}</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">ftp帐号</label>
                <div class="layui-form-mid layui-word-aux">{$article.ftp_name}</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">ftp密码</label>
                <div class="layui-form-mid layui-word-aux">{$article.ftp_pwd}</div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">封顶金额</label>
                <div class="layui-form-mid layui-word-aux">{$article.topMoney}</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">备注</label>
                <div class="layui-form-mid layui-word-aux">
                    {$article.content}
                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="script"}
<script>

    layui.config({
        base: '__STATIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: '/lib/index' //主入口模块
    }).use(['index', 'table', 'jquery', 'layer', 'form'], function () {
        var $ = layui.$, form = layui.form;

        form.on('radio(istop)', function (data) {
            var value = data.value; //被点击的radio的value值
            if (value == 1) {
                layer.tips('请输入封顶金额', '#topMoney', {tips: 1});
                $('#topMoney').attr("readOnly", false);
            } else {
                $('#topMoney').val(0);
                $('#topMoney').attr("readOnly", true);
            }
        });
        form.on('submit(btnSave)', function (data) {
            $.post("{:url('edit')}", data.field, function (result) {
                console.log(result);
                if (result['code'] == 0) {
                    layer.msg(result['msg'], {icon: 1, time: 1000}, function () {
                        parent.location.reload();
                    });
                } else {
                    layer.msg(result['msg'], {icon: 3, time: 3000});
                }
            });
            return false;
        });
    });

</script>
{/block}